#include <iostream>
#include "interpreter.h"
#include <log4cxx/logger.h>
#include <log4cxx/xml/domconfigurator.h>

using namespace log4cxx;
using namespace log4cxx::xml;
using namespace log4cxx::helpers;


using namespace std;
LoggerPtr    logger(Logger::getLogger("MyApp")); 
int main(int argc, char **argv)
{
  Interpreter m;

  // Set up a simple configuration that logs on the console.
  BasicConfigurator::configure();

  logger->setLevel(Level::getTrace());
  LOG4CXX_INFO(logger, "Entering application.");

  if (argc <= 1)
    {
      cerr << "aghh\n";
      return -1;
    }
  //
  string v("unlock_1");
  m.buildmachine(argv[1]);
  m.push_event(v);
  v = "unlock_2";
  m.push_event(v);
  v = "lock_1";
  m.push_event(v);
  v = "lock_2";
  m.push_event(v);
  m.run();
  LOG4CXX_INFO(logger, "Exit application.");
  //
  return 0;
}
